<?php
/*
Template Name: Bloguinho
*/
	$moranguinho = 'nao';
	$logged = 'nao';
	$id='wrapper-bloguinho';
	include 'header.php';


	$slideshow = get_id_by_post_name('slideshow-bloguinho');
	$slides = get_group('slide',$slideshow);
	$slidecount = count($slides);
?>
			<div class="wrapper-content">
				<?php include 'login-panel.php'; ?>
				<span class="clear"></span>				
				<div class="extra-wrapper-slide-diversao bloguinho">
					<div class="extra-wrapper-slideshow-blog">
						<div class="wrapper-slideshow-blog">
							<ul>
							<?php for ($i=1; $i <= $slidecount ; $i++) { 
							$postr = get('slide_post',$i,1,$slideshow);	?>
								<li>
									<a href="<?php echo get_permalink($postr); ?>">
										<?php echo get_the_post_thumbnail($postr,'post-slideshow'); ?>
									</a>
								</li>	
							<?php } ?>
							</ul>					
						</div>
						<a href="#" class="wrapper-slideshow-blog-control-prev">&lsaquo;</a>
						<a href="#" class="wrapper-slideshow-blog-control-next">&rsaquo;</a>
					</div>
					<span class="clear"></span>
					<div class="wrapper-content-blog-home">
						<div class="narrow-content">
							<ul>
								<?php

								$query = new WP_Query( array(
								'post_type' => 'post',
							    'posts_per_page' => 4
								) );
								if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
									<li>
										<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('post-destaque-lista'); ?>
										<img class="moldura-lista-blog" src="<?php bloginfo('template_directory')?>/img/moldura-destaque-blog.png?8" alt=""/></a>
									</li>
								<?php endwhile; else: ?>
								<?php endif; ?>
								<?php wp_reset_postdata(); ?>
							</ul>
						</div>
						<div class="sidebar-home">
							<ul>
								<li class="redes-sociais-sidebar">
									<div class="wrapper-sociais-sidebar">
										<span class="pinterest"><a target="_blank" href="<?php echo get_custom('pinterest'); ?>">Pinterest</a></span>
										<span class="facebook"><a target="_blank" href="<?php echo get_custom('facebook'); ?>">Facebook</a></span>
									</div>
								</li>
								<li class="mais-lidos-sidebar">
									<span class="tit-mais-lidos">Mais Lidos</span>
									<ul>
									<?php 
										$side_query = new WP_Query( array(
										'post_type' => 'post',
									    'meta_key' => 'wpb_post_views_count',
									    'orderby' => 'meta_value_num',
									    'posts_per_page' => 4
										) );
										if ( $side_query->have_posts() ) : while ( $side_query->have_posts() ) : $side_query->the_post(); ?>
											<li>
												<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('post-side-lista'); ?></a>
												<span class="tit-post"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></span>
												<span class="clear"></span>
											</li>
										<?php endwhile; else: ?>
										<?php endif; ?>
										<?php wp_reset_postdata(); ?>
										<span class="clear"></span>
									</ul>
								</li>
							</ul>
						</div>
					</div>
				</div><!-- /extra-wrapper-slide-diversao -->
				<span class="clear"></span>
				<div class="destaque-produtos jogos-diversao-produtos">
					<?php include 'slide-produtos.php'; ?>
				</div><!-- /destaque-produtos -->
				<div class="wrapper-destaques-diversao destaques-menores">
					<div class="conteudo-exclusivo">
						<img src="<?php bloginfo('template_directory')?>/img/conteudos-exclusivos.png?5" alt=""/>
					</div>
					<ul>
						<li>
							<div class="tit-categoria">
								<a href="<?php bloginfo('url'); ?>/videos"><span class="amarelo">Vídeos</span>
								<img src="<?php bloginfo('template_directory')?>/img/moldura-destaque-categoria.png?6" alt=""/></a>
							</div>
							<div class="wrapper-img-destaque-diversao">
								<a href="<?php bloginfo('url'); ?>/videos"><img src="<?php bloginfo('template_directory')?>/img/diversao-destaque-videos.png" alt=""/></a>
							</div>
							<a href="<?php bloginfo('url'); ?>/videos" class="clique-aqui">Clique Aqui</a>
						</li>
						<li>
							<div class="tit-categoria">
								<a href="<?php bloginfo('url'); ?>/desenhos" ><span class="roxo">Desenhar</span>
								<img src="<?php bloginfo('template_directory')?>/img/moldura-destaque-categoria.png?6" alt=""/></a>
							</div>
							<div class="wrapper-img-destaque-diversao">
								<a href="<?php bloginfo('url'); ?>/desenhos"><img src="<?php bloginfo('template_directory')?>/img/diversao-destaque-desenhar.png?7" alt=""/></a>
							</div>
							<a href="<?php bloginfo('url'); ?>/desenhos" class="clique-aqui">Clique Aqui</a>
						</li>
						<li>
							<div class="tit-categoria">
								<a href="<?php bloginfo('url'); ?>/wallpapers"><span class="verde">Papéis de Parede</span>
								<img src="<?php bloginfo('template_directory')?>/img/moldura-destaque-categoria.png?6" alt=""/></a>
							</div>
							<div class="wrapper-img-destaque-diversao">
								<a href="<?php bloginfo('url'); ?>/wallpapers"><img src="<?php bloginfo('template_directory')?>/img/diversao-destaque-papeis.png?6" alt=""/></a>
							</div>
							<a href="<?php bloginfo('url'); ?>/wallpapers" class="clique-aqui">Clique Aqui</a>
						</li>
						<li class="no-margin-right">
							<div class="tit-categoria">
								<a href="<?php bloginfo('url'); ?>/jogos"><span class="roxo-amarelo">Jogar</span>
								<img src="<?php bloginfo('template_directory')?>/img/moldura-destaque-categoria.png?6" alt=""/></a>
							</div>
							<div class="wrapper-img-destaque-diversao">
								<a href="<?php bloginfo('url'); ?>/jogos"><img src="<?php bloginfo('template_directory')?>/img/diversao-destaque-jogar.png?6" alt=""/></a>
							</div>
							<a href="<?php bloginfo('url'); ?>/jogos" class="clique-aqui">Clique Aqui</a>
						</li>
						<span class="clear"></span>
					</ul>
					<span class="clear"></span>
				</div><!-- /wrapper-destaques-diversao -->
				<span class="clear"></span>
			</div><!-- /wrapper-content -->
			<span class="clear"></span>
		</div><!-- /container -->
		<span class="clear"></span>
	</div> <!-- /wrapper-container -->
	<span class="clear"></span>
<?php include 'footer.php'; ?>